Page({
  data: {
    isLike: true,
    // banner
    indicatorDots: true, //是否显示面板指示点
    autoplay: true, //是否自动切换
    interval: 3000, //自动切换时间间隔,3s
    duration: 1000,//	滑动动画时长1s
    imgUrls: [
      'https://img11.360buyimg.com/n1/jfs/t1/244526/40/2167/76580/6597db59F942cdf99/04b37dc3d5b15c5b.jpg.avif',
      'https://img11.360buyimg.com/n1/jfs/t1/228982/20/11591/82880/6597db5aF7b7b8481/ecaf28e6e0f7cd37.jpg.avif',
      'https://img11.360buyimg.com/n1/jfs/t1/240856/27/2266/110028/6597db5aFbaab02fb/3080a9626a31900b.jpg.avif',
      'https://img11.360buyimg.com/n1/jfs/t1/229282/28/11073/72984/6597db81Ff170ec98/52e81065f66e2277.jpg.avif',
      'https://img11.360buyimg.com/n1/jfs/t1/238367/29/10129/91271/6597db59F69544da0/934567b8e1592251.jpg.avif'

    ],


    // 商品详情介绍
    detailImg: [
 "http://img30.360buyimg.com/popWareDetail/jfs/t1/149209/34/8881/295770/5f66b92bEb52123df/d98f534fa39c58c9.jpg",
"https://img10.360buyimg.com/imgzone/jfs/t1/122243/18/13183/307961/5f66b89fE55f3e290/9be151f84ecf653c.jpg",
"https://img10.360buyimg.com/imgzone/jfs/t1/116459/24/18278/406147/5f66b89fE65575216/dd29a570e304cb50.jpg",
 "https://img10.360buyimg.com/imgzone/jfs/t1/153579/9/321/215032/5f66b89fEdf2201cf/3790a998da830d5c.jpg",

 "https://img10.360buyimg.com/imgzone/jfs/t1/138153/21/8798/106631/5f66b89fE31baabe6/4d45bb1d2ee6a1d2.jpg",

     
    ],
  },
  //预览图片
  onLoad() {
    console.log(this.data.imgUrls); // 检查数据是否正常
  },
  previewImage(e) {
    wx.previewImage({
      current: e.currentTarget.dataset.src,
      urls: this.data.imgUrls

    })
  },
  // 收藏
  addLike() {
    this.setData({
      isLike: !this.data.isLike
    });
  },
  // 跳到购物车
  toCar() {
    wx.switchTab({
      url: '/pages/cart/cart'
    })
  },
  // 立即购买
  immeBuy() {
    wx.showToast({
      title: '购买成功',
      icon: 'success',
      duration: 2000
    });
  },
})
